#include <cstdio>

int f[ 3000001 ];
bool visit[ 3000001 ];

void init( )
{
    int i, j;
    for ( i = 1; i <= 3000000; i++ ) f[ i ] = i;
    for ( i = 2; i <= 3000000; i++ )
        if ( !visit[ i ] )
            for ( j = i; j <= 3000000; j += i )
            {
                f[ j ] = f[ j ] / i * ( i - 1 );
                visit[ j ] = true;
            }
}

int main( )
{
    int a, b, i;
    __int64 t;
    init( );
    while ( scanf("%d%d", &a, &b) != EOF )
    {
        t = 0;
        for ( i = a; i <= b; i++ ) t += f[ i ];
        printf("%I64d\n", t);
    }
    return 0;
}
